<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@page import="dao.NoteDao" import="java.util.*" import="model.NoteModel" %>
	
<%
request.setCharacterEncoding("utf-8");
int uid = (Integer)session.getAttribute("id");

NoteDao dao = new NoteDao();
ArrayList<NoteModel> list = dao.selectALL(uid);

for(int i=0;i<list.size();i++){
	String s = list.get(i).getTitle();
	String title;
	if(s.length()>80){
		title = s.substring(0,80)+"...";
	}else{
		title = s;
	}
	
%>
            <li>
            <div class="lt">
                <a class="lists-title" href="detail.jsp?id=<%=list.get(i).getId()%>"><%=title%></a>
                <span><%=list.get(i).getDate()%></span>
                </div>
                <div class="gt">
                <%if(list.get(i).getShare()==0) {%>
                <i url="doshare.jsp" ids="<%=list.get(i).getId()%>" class="i-lt">分享</i>
                <% }else{%>
                <i url="donoshare.jsp" ids="<%=list.get(i).getId()%>" class="i-lt">取消分享</i>
                <%} %>
                <i url="delete.jsp" ids="<%=list.get(i).getId()%>" class="i-gt">删除</i>
                </div>
            </li>          
 <%} %>
           